package beans;

import java.util.List;

import dao.Chatmessage;
import dao.ChatmessageDAO;

public class ChatMessagebean {
    private ChatmessageDAO chatmessageDao;
    public ChatMessagebean(){
	chatmessageDao = new ChatmessageDAO();
    }
    
    public List<Chatmessage> findDes(String desId,String flag){
	return chatmessageDao.findDes(desId, flag);
    }
    
    public List<Chatmessage> findSource(String source,String flag){
	return chatmessageDao.findSource(source, flag);
    }
    
    public boolean save(Chatmessage transientInstance) {
	return chatmessageDao.save(transientInstance);
    }
    
    public List<Chatmessage> findMessageByids(List<Integer> idList){
	System.out.println(idList.get(0)+"--"+idList.size());
	return chatmessageDao.findMessageByids(idList);
    }
    
    public Chatmessage findMessageById(int id){
	return chatmessageDao.findById(id);
    }
    public boolean saveReply(Chatmessage message,int id){
	return chatmessageDao.saveReply(message, id);
    }
}
